﻿Option Strict Off
Option Explicit On
Imports System

Namespace Data_ReportTableAdapters
    Public Class R05TableAdapter
        Inherits System.ComponentModel.Component

        Public Function SearchReport(ByVal dataTable As Data_Report.R05DataTable, ByVal SQL As String) As Integer
            Dim text1 As String
            text1 = Me.CommandCollection(0).CommandText
            Dim timeout As Integer
            Dim newtime As Integer = timeout
            Try
                newtime = Val(ConfigurationManager.AppSettings("QueryTimeOut"))
            Catch ex As Exception
                newtime = timeout
            End Try
            timeout = Me.CommandCollection(0).CommandTimeout
            Try
                Me.CommandCollection(0).CommandText = SQL
                Me.CommandCollection(0).CommandTimeout = newtime
                Return Me.Fill(dataTable)
            Catch ex As Exception

            Finally
                Me.CommandCollection(0).CommandText = text1
                Me.CommandCollection(0).CommandTimeout = timeout
            End Try

        End Function

    End Class
    Public Class SumAmountTableAdapter
        Inherits System.ComponentModel.Component

        Public Function GetAmountData(ByVal SQL As String) As Decimal
            Dim text1 As String
            text1 = Me.CommandCollection(1).CommandText
            'Try
            Me.CommandCollection(1).CommandText = SQL
            Return Me.SumAmount
        End Function
    End Class
End Namespace